#!/bin/bash
#SBATCH -J poisson_serial
#SBATCH --partition long
#SBATCH --nodes 1
#SBATCH --ntasks 1
#SBATCH --cpus-per-task 8
#SBATCH --ntasks-per-node 1
#SBATCH --time 36:00:00

echo $SLURM_NODELIST
echo $SLURM_JOB_NAME
echo $SLURM_PRIO_PROCESS
echo $SLURM_SUBMIT_DIR

echo 'Teste opt - v1.7 LONG ######################################'

gcc -Wall -O3 -march=native -mtune=native -msse3 -mfpmath=sse -fopenmp -c main.c -o obj/Release/main.o
gcc -Wall -O3 -march=native -mtune=native -msse3 -mfpmath=sse -fopenmp -c src/libpoisson.c -o obj/Release/src/libpoisson.o
g++ -o bin/Release/poisson_07_LONG obj/Release/main.o obj/Release/src/libpoisson.o -s -lgomp -lm

echo 'Testando Poisson com 512x512'

for i in $(seq 6)
do
        echo 'Rodando ' $i
        srun bin/Release/poisson_07_LONG 514
done

echo 'Testando Poisson com 1024x1024'
for i in $(seq 3)
do
        echo 'Rodando ' $i
        srun bin/Release/poisson_07_LONG 1026
done

echo 'Testando Poisson com 2048x2048'
for i in $(seq 3)
do
        echo 'Rodando ' $i
        srun bin/Release/poisson_07_LONG 2050
done

